var callbackObj;
var dialogId;
var dialogDg;
var dialogRewidth = 1000;
var dialogReheight = 650;

function convert2ObjBean(row){
    var arr = [];
    var row2 = {};
    for(prop in row){
        arr.push(prop);
        var prop2 = toBeanStyleName(prop);
        row2[prop2] = row[prop];
    }
    $(arr).each(function(){
        delete row[this];
    });
    $.extend(row,row2);
    return row;
}

function toBeanStyleName(str){
    if(str.indexOf('_') == -1)return str;
    var arr = str.split('');
    var newstr = [];
    var changeCase = false;
    for(var i = 0;i < arr.length;i++){
        var s = arr[i];
        if(arr[i] == '_'){
            changeCase = true;
            continue;
        }
        if(changeCase){
            s = s.toUpperCase();
            changeCase = false;
        }
        newstr.push(s);
    }
    return newstr.join('');
}

/**
 * 将数据返回父窗口
 * @param {Object} value
 * dep:none
 */
function returnVal2Parent(value){
    if(!!window.parentCallback){
        window.parentCallback(value);
    }
}

/**
 * 将数据返回父窗口
 * @param {Object} value
 * dep:none
 */
function returnVal2ParentDialog(value){
    callbackObj = value;
}

function getIFrameWidth(){
    return $(window.parent.document).find("#mainTabs").width();
}

function getIFrameHeight(){
    return $(window.parent.document).find("#mainTabs").height() - 5;
}

function getWindowWidth(){
    return $(window).width();
}

function getWindowHeight(){
    return $(window).height() - 5;
}